import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn } from 'typeorm';

@Entity('performance_metrics')
export class PerformanceMetric {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  serviceId: string;

  @Column()
  serviceName: string;

  @Column('float')
  responseTime: number;

  @Column('float')
  errorRate: number;

  @Column('int')
  requestCount: number;

  @Column({ nullable: true })
  endpoint: string;

  @Column({ nullable: true })
  region: string;

  @Column({ default: 'production' })
  environment: string;

  @CreateDateColumn()
  timestamp: Date;
} 